package com.dongwu.manager.entity;


import com.dongwu.common.entity.BaseEntity;
import com.dongwu.security.entity.User;
import com.fasterxml.jackson.annotation.JsonBackReference;

import javax.persistence.*;
import java.util.List;
@Entity
public class Device extends BaseEntity<String>{
    //设备型号
    private String model;
    //设备名称
    private String deviceName;
    //设备背景音乐
    private String backgroundImg;
    //设备背景图
    private String backgroundMusic;
    //设备位置
    private String address;

	//MAC地址
    private String sn;

	//云科号
	private String yunkeNum;

    //城市
    private String city;
	//商家名称
	private String businessName;

	//内部编号
	private String internalNum;

	//商家属性(0表示内部属性，1表示外部属性)
	private Integer businessAttribute;
	//联系电话
	private String mobile;

	//设备展示(0表示横屏，1表示竖屏)
	private Integer showType;
	
    public enum Status{
		//待审核
		pendingApproval,
		//审核不通过
		referApproval,
		//审核通过
		passApproval
    }
    public enum iMStatusType{
    	//在线
    	Online,
    	//离线
    	Offline,
    	//下线状态能接收离线消息
    	PushOnline
    }
    @ManyToOne(cascade= {CascadeType.REFRESH})
    @JoinColumn(name="userid")
    private User user;
    
    @JsonBackReference
    @ManyToMany(cascade= CascadeType.REFRESH, mappedBy = "device")
    private List<Culture> culture;
    //审核状态
    private Status status;
    //IM状态
    private iMStatusType IMStatus;
    //备注
    private String remark;
    
    //设备切换速度
  	private Integer switchingSpeed;

	//广投墙模板ID
	@OneToOne(cascade= {CascadeType.REFRESH})
	@JoinColumn(name="appTemplateId")
	private AppTemplate appTemplate;

	private String resolution; // 分辨率

	private String templateTypeSn; //模板类别唯一编码
  	
    //审核备注
	public String getRemark() {
		return remark;
	}
	
	public void setRemark(String remark) {
		this.remark = remark;
	}

	public iMStatusType getIMStatus() {
		return IMStatus;
	}

	public void setIMStatus(iMStatusType iMStatus) {
		IMStatus = iMStatus;
	}

	public String getDeviceName() {
		return deviceName;
	}

	public void setDeviceName(String deviceName) {
		this.deviceName = deviceName;
	}

	public String getAddress() {
		return address;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getBackgroundImg() {
		return backgroundImg;
	}

	public String getBackgroundMusic() {
		return backgroundMusic;
	}

	public String getModel() {
		return model;
	}

	public String getSn() {
		return sn;
	}

	public Status getStatus() {
		return status;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setBackgroundImg(String backgroundImg) {
		this.backgroundImg = backgroundImg;
	}

	public void setBackgroundMusic(String backgroundMusic) {
		this.backgroundMusic = backgroundMusic;
	}
	public void setModel(String model) {
		this.model = model;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

    public void setStatus(Status status) {
		this.status = status;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getBusinessName() {
		return businessName;
	}

	public void setBusinessName(String businessName) {
		this.businessName = businessName;
	}

	public String getInternalNum() {
		return internalNum;
	}

	public void setInternalNum(String internalNum) {
		this.internalNum = internalNum;
	}

	public Integer getBusinessAttribute() {
		return businessAttribute;
	}

	public void setBusinessAttribute(Integer businessAttribute) {
		this.businessAttribute = businessAttribute;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public Integer getShowType() {
		return showType;
	}

	public void setShowType(Integer showType) {
		this.showType = showType;
	}

	public String getYunkeNum() {
		return yunkeNum;
	}

	public void setYunkeNum(String yunkeNum) {
		this.yunkeNum = yunkeNum;
	}

	public Integer getSwitchingSpeed() {
		return switchingSpeed;
	}

	public void setSwitchingSpeed(Integer switchingSpeed) {
		this.switchingSpeed = switchingSpeed;
	}

	public List<Culture> getCulture() {
		return culture;
	}

	public void setCulture(List<Culture> culture) {
		this.culture = culture;
	}

	public AppTemplate getAppTemplate() {
		return appTemplate;
	}

	public void setAppTemplate(AppTemplate appTemplate) {
		this.appTemplate = appTemplate;
	}

	public String getResolution() {
		return resolution;
	}

	public void setResolution(String resolution) {
		this.resolution = resolution;
	}

	public String getTemplateTypeSn() {
		return templateTypeSn;
	}

	public void setTemplateTypeSn(String templateTypeSn) {
		this.templateTypeSn = templateTypeSn;
	}
}